class HomeListEntity {
  List<HomeListDataData> data;
  int code;
  String msg;
  HomeListEntity({this.data, this.code, this.msg});
  HomeListEntity.fromJson(Map<String, dynamic> json) {
     if (json['data']['list'] != null) {
      data = new List<HomeListDataData>();
      (json['data']['list'] as List).forEach((v) {
        data.add(new HomeListDataData.fromJson(v));
      });
     }
    code = json['code'];
    msg = json['msg'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.data != null) {
      data['data']['list'] = this.data.map((v) => v.toJson()).toList();
    }
    data['code'] = this.code;
    data['msg'] = this.msg;
    return data;
  }

}
class HomeListDataData {
  String href;
  String article_id;
  String title;
  String author;
  String keywords;
  String pubtime;
  String img;
  String clicknum;
  String description;
  String imglist;
  List<String> imglists;

  HomeListDataData(
      {this.article_id,
      this.description,
      this.title,
      this.author,
      this.imglist,
      this.keywords,
      this.href,
      this.pubtime,
      this.img,
      this.clicknum});

  HomeListDataData.fromJson(Map<String, dynamic> json) {
    article_id = json['article_id'].toString();
    title = json['title'].toString();
    author = json['author'].toString();
    keywords = json['keywords'].toString();
    href = json['href'].toString();
    pubtime = json['pubtime'].toString();
    img = json['img'];
    imglist = json['imglist'].toString();
    print(imglist);
    if (imglist.length > 5) {
      imglists = imglist.replaceAll('[', '').replaceAll(']', '').replaceAll(" ", "").split(",");
    } else {
      imglists = new List();
      imglists.add(img);
    }
    clicknum = json['clicknum'].toString();
    description = json['description'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['article_id'] = this.article_id;
    data['title'] = this.title;
    data['author'] = this.author;
    data['keywords'] = this.keywords;
    data['pubtime'] = this.pubtime;
    data['img'] = this.img;
    data['href'] = this.href;
    data['imglist'] = this.imglist;
    data['clicknum'] = this.clicknum;
    data['description'] = this.description;
    return data;
  }
}